import {request} from 'umi';
import {getApiPrefix} from "@/assets/utils/utils";
import {modulesUrl} from "@/assets/constant/modulesUrl";
import {PageParamAnalysis} from "@/pages/analysis/PageParamAnalysis/data";

// /**
//  * 获取Url列表
//  * @param params
//  */
// export async function listUrl() {
//   return request(getApiPrefix(modulesUrl.analysisParamPage) + "/listUrl");
// }
//
// /**
//  * 直接显示同级11条
//  * @param params
//  */
// export async function listTotal2(params?: any) {
//   return request(getApiPrefix(modulesUrl.analysisParamPage) + "/listTotal2", {
//     params,
//   });
// }

/**
 * 获取列表
 * @param params
 */
export async function list(params?: any) {
  return request(getApiPrefix(modulesUrl.analysisParamPage) + "/list", {
    params,
  });
}

/**
 * 获取地市
 * @param params
 */
export async function listCity(params?: PageParamAnalysis) {
  return request(getApiPrefix(modulesUrl.analysisParamPage) + "/listCity", {
    params,
  });
}

/**
 * 获取子节点
 * @param params
 */
export async function listChildren(params?: PageParamAnalysis) {
  return request(getApiPrefix(modulesUrl.analysisParamPage) + "/listChildren", {
    params,
  });
}

/**
 * 获取子节点地市
 * @param params
 */
export async function listChildCity(params?: PageParamAnalysis) {
  return request(getApiPrefix(modulesUrl.analysisParamPage) + "/listChildCity", {
    method: 'POST',
    data: {
      ...params,
    },
  });
}

/**
 * 获取访前
 * @param params
 */
export async function listVisitBefore(params?: PageParamAnalysis) {
  return request(getApiPrefix(modulesUrl.analysisParamPage) + "/listVisitBefore", {
    params,
  });
}

/**
 * 获取访前地市
 * @param params
 */
export async function listVisitBeforeCity(params?: PageParamAnalysis) {
  return request(getApiPrefix(modulesUrl.analysisParamPage) + "/listVisitBeforeCity", {
    method: 'POST',
    data: {
      ...params,
    },
  });
}


